Generated code - QuerySpec, Prefetch paths

To specify prefetch paths, an EntityQuery<T> has the method WithPath(prefetchPath). This method accepts one or more prefetch path element instances which can be created with the generated static properties in the generated code (see Adapter or SelfServicing)

Prefetch path elements have the following extension methods to configure them:

Example
var qf = new QueryFactory();
var q = qf.Customer
	.Where(CustomerFields.CustomerId.NotIn(new string[] { "FISSA", "PARIS" }))
	.WithPath(CustomerEntity.PrefetchPathOrders
			.WithFilter(OrderFields.EmployeeId == 2)
			.WithOrdering(OrderFields.OrderDate.Ascending())
			.WithLimit(3));


The above query fetches all customers which don't have the values FISSA or PARIS as CustomerId and with that fetches their first three related Order entities which have for EmployeeId the value 2. The first two are fetched only as the prefetch path node for Order will sort the orders by OrderDate ascending.

Please also see the shipped example queries for various usages of the methods mentioned above.


LLBLGen Pro Runtime Framework v3.5 documentation. ©2012 Solutions Design bv